package avicit.bdp.dgs.mdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import avicit.platform6.core.properties.PlatformConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @金航数码科技有限责任公司
 * @作者：${tableInfo.classCreator}
 * @邮箱：${tableInfo.classMailbox}
 * @创建时间： 2023-12-06 11:02
 * @类说明：
 * @修改记录：
 */
@ApiModel(value = "MdataRInterfaceDTO", description = "主数据接口关系表")
@Table(name = "bdp_dgs_mdata_r_interface")
public class MdataRInterfaceDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键", name = "id")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 接口ID
     */
    @LogField
    @ApiModelProperty(value = "接口ID", name = "interfaceId")
    @FieldRemark(column = "interface_id", field = "interfaceId", name = "接口ID")
    private String interfaceId;

    /**
     * 主数据ID
     */
    @LogField
    @ApiModelProperty(value = "主数据ID", name = "mdataId")
    @FieldRemark(column = "mdata_id", field = "mdataId", name = "主数据ID")
    private String mdataId;

    /**
     * 数据挂载节点名称
     */
    @LogField
    @ApiModelProperty(value = "数据挂载节点名称", name = "nodeName")
    @FieldRemark(column = "node_name", field = "nodeName", name = "数据挂载节点名称")
    private String nodeName;

    /**
     * 描述
     */
    @LogField
    @ApiModelProperty(value = "描述", name = "remark")
    @FieldRemark(column = "remark", field = "remark", name = "描述")
    private String remark;

    @Transient
    private String mdataName;

    public String getMdataName() {
        return mdataName;
    }

    public void setMdataName(String mdataName) {
        this.mdataName = mdataName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getInterfaceId() {
        return interfaceId;
    }

    public void setInterfaceId(String interfaceId) {
        this.interfaceId = interfaceId;
    }

    public String getMdataId() {
        return mdataId;
    }

    public void setMdataId(String mdataId) {
        this.mdataId = mdataId;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "bdp_dgs_mdata_r_interface";
        } else {
            return super.logFormName;
        }
    }

    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "bdp_dgs_mdata_r_interface";
        } else {
            return super.logTitle;
        }
    }

    public PlatformConstant.LogType getLogType() {
        if (super.logType == null) {
            return PlatformConstant.LogType.module_operate;
        } else {
            return super.logType;
        }
    }

}
